import { Game } from '@/type'
import { invoke } from '@tauri-apps/api/core'

export function openGame(game: Game) {
  switch (game.openMode) {
    case 'file':
      invoke('open_file', { path: game.openFilePath })
      break
    case 'cmd':
      invoke('execute_command', { command: game.openCmd })
      break
    default:
      break
  }
}
